﻿using System.Threading.Tasks;

namespace YNTK.Common.Core.Captcha.General
{
    /// <summary>
    /// 常规验证码
    /// </summary>
    public interface IGeneralCaptcha
    {
        /// <summary>
        /// 创建验证码图片
        /// </summary>
        /// <param name="timestamp">时间戳</param>
        /// <param name="length">长度</param>
        /// <param name="width">宽度</param>
        /// <param name="height">高度</param>
        /// <returns></returns>
        byte[] CreateCaptchaImage(string timestamp, int width, int height, int length = 4);

        /// <summary>
        /// 生成简洁漂亮的图形验证码
        /// </summary>
        /// <param name="timestamp">时间戳</param>
        /// <param name="codeLength">验证码长度</param>
        /// <param name="width">生成验证码图片的宽度</param>
        /// <param name="height">生成验证码图片的高度</param>
        /// <param name="fontSize">验证码字符大小</param>
        /// <returns>图片byte[]和code</returns>
        Task<(byte[] imgBytes, string code)> CreateValidateGraphic(
            string timestamp,int codeLength, int width, int height, int fontSize);

        /// <summary>
        /// 加减乘除计算验证码
        /// </summary>
        /// <param name="timestamp">时间戳</param>
        /// <returns></returns>
        Task<(byte[] imgBytes, string code)> CreateValidateGraphic(string timestamp);
    }
}
